package org.jeecg.modules.forward;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.shiro.vo.DefContants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;

/**
 * 类的作用
 *
 * @author liujiamiao
 * @email 2544296058@qq.com
 * @date 2020-12-02 17:16
 */
@Controller
@RequestMapping("/forward")
@Slf4j
public class ZuulForwardController {


    @GetMapping("/zuul")
    public void getCheckCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
        StringBuffer requestURL = request.getRequestURL();
        System.out.println(requestURL.toString());
        String path = request.getServletPath();
        System.out.println(path);

        String url = "http://localhost:8070/zuul/user/render.html?shareid=J7wqanQF&key1="+URLEncoder.encode("设计院","UTF-8");
        response.sendRedirect(url);
    }

}
